package com.example.papermanagemant.service;

import com.example.papermanagemant.model.User;
import com.example.papermanagemant.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    // 根据用户名查找用户
    public User findByName(String name) {
        return userRepository.findByName(name);
    }

    // 保存用户
    public User save(User user) {
        return userRepository.save(user);
    }
}
